<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="resources/templates/mainTemplate.xhtml">
    
    <ui:param name="pagetitle" value="CHUMS - Log in"/>
    
    <ui:define name="centerContent" class="turquaz">   
    
        <p:ajaxStatus onstart="statusDialog.show();" onsuccess="statusDialog.hide();"/>  

        <p:dialog appendToBody="true" resizable="false" modal="true" widgetVar="statusDialog" header="#{messages['ajax.status']}"   
                  draggable="false" closable="false">  
            <p:graphicImage value="resources/images/ajax-loader.gif" />
        </p:dialog>

        <p:fieldset legend="Log In">  
            <h:form id="form">  
                <p:message for="form" />
                <table>
                    <tr>
                        <td>
                            Username:
                        </td>
                        <td>
                            <p:inputText id="username" value="#{loginBean.user.username}"/>

                        </td>
                        <td>

                            <p:message for="username" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Password
                        </td>
                        <td>
                            <p:password id="password" value="#{loginBean.user.password}"/>

                        </td>
                        <td>

                            <p:message for="password" />
                        </td>
                    </tr>
                    <tr>
                        <td>

                        </td>
                        <td>
                            <p:commandButton id="submit" value="Submit" update="form" action="#{loginBean.login}"/>
                        </td>
                        <td>

                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <a href="resetPass.xhtml?faces-redirect=true">
                                Forgot Password
                            </a>
                        </td>
                        <td>

                        </td>
                    </tr>

                </table>

                <p:defaultCommand target="submit" />
            </h:form>
        </p:fieldset>
        
    </ui:define>
    
</ui:composition>

